home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / SAMPLES / VISDATA / PROPERTY.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-23  |  3.2 KB  |  113 lines

  1. VERSION 5.00
  2. Begin VB.Form frmProperty 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Property Value"
  5.    ClientHeight    =   1215
  6.    ClientLeft      =   2655
  7.    ClientTop       =   3135
  8.    ClientWidth     =   5400
  9.    LinkTopic       =   "Form1"
  10.    LockControls    =   -1  'True
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1215
  14.    ScaleWidth      =   5400
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.TextBox txtPropValue 
  18.       Height          =   300
  19.       Left            =   135
  20.       TabIndex        =   1
  21.       Top             =   315
  22.       Width           =   5070
  23.    End
  24.    Begin VB.CommandButton cmdCancel 
  25.       Cancel          =   -1  'True
  26.       Caption         =   "&Cancel"
  27.       Height          =   360
  28.       Left            =   3735
  29.       TabIndex        =   3
  30.       Top             =   720
  31.       Width           =   1335
  32.    End
  33.    Begin VB.CommandButton cmdOK 
  34.       Caption         =   "&OK"
  35.       Default         =   -1  'True
  36.       Height          =   360
  37.       Left            =   2190
  38.       TabIndex        =   2
  39.       Top             =   720
  40.       Width           =   1335
  41.    End
  42.    Begin VB.CheckBox chkPropValue 
  43.       Caption         =   "Check1"
  44.       Height          =   300
  45.       Left            =   135
  46.       TabIndex        =   4
  47.       Top             =   315
  48.       Width           =   5070
  49.    End
  50.    Begin VB.Label lblLabel 
  51.       Caption         =   "&Enter property value:"
  52.       Height          =   225
  53.       Left            =   135
  54.       TabIndex        =   0
  55.       Top             =   60
  56.       Width           =   4365
  57.    End
  58. Attribute VB_Name = "frmProperty"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Option Explicit
  64. '>>>>>>>>>>>>>>>>>>>>>>>>
  65. Const FORMCAPTION = " Property Value"
  66. Const BUTTON1 = "&OK"
  67. Const BUTTON2 = "&Cancel"
  68. Const Label1 = "&Enter property value:"
  69. '>>>>>>>>>>>>>>>>>>>>>>>>
  70. Public PropObject As DAO.Property
  71. Public OK As Boolean
  72. Private Sub cmdCancel_Click()
  73.   OK = False
  74.   Me.Hide
  75. End Sub
  76. Private Sub cmdOK_Click()
  77.   On Error GoTo cmdOK_ClickErr
  78.   'try to set it
  79.   If PropObject.Type = dbBoolean Then
  80.     PropObject.Value = (chkPropValue.Value = vbChecked)
  81.   Else
  82.     If txtPropValue.Text <> PropObject.Value Then
  83.       'reset if changed
  84.       PropObject.Value = txtPropValue.Text
  85.     End If
  86.   End If
  87.   OK = True
  88.   Me.Hide
  89.   Exit Sub
  90. cmdOK_ClickErr:
  91.   MsgBox Err.Description
  92.   If PropObject.Type = dbBoolean Then
  93.     chkPropValue.SetFocus
  94.   Else
  95.     txtPropValue.SetFocus
  96.   End If
  97. End Sub
  98. Private Sub Form_Load()
  99.   Me.Caption = PropObject.Name & FORMCAPTION
  100.   cmdOK.Caption = BUTTON1
  101.   cmdCancel.Caption = BUTTON2
  102.   lblLabel.Caption = Label1
  103.   'setup the controls for the prop type
  104.   If PropObject.Type = dbBoolean Then
  105.     txtPropValue.Visible = False
  106.     chkPropValue.TabIndex = 1
  107.     chkPropValue.Caption = PropObject.Name
  108.     chkPropValue.Value = (PropObject.Value And vbChecked)
  109.   Else
  110.     txtPropValue.Text = PropObject.Value
  111.   End If
  112. End Sub
  113.